#pragma once

namespace Rz {

template <typename T>
class Singleton
{
	public:
		static T& GetInstance()
		{
			if (!_instance)
				_instance = new T;
			
			return *_instance;
		}

		static T* GetInstancePtr()
		{
			if (!_instance)
				_instance = new T;

			return _instance;
		}

		static void DestroyInstance()
		{
			delete _instance;
			_instance = nullptr;
		}

	protected:
		Singleton()
		{

		}

		virtual ~Singleton()
		{

		}

	private:
		Singleton(const Singleton&)
		{

		}

		static T* _instance;

};

template <class T> T* Singleton<T>::_instance = nullptr;

}
